/*
 * @Author: your name
 * @Date: 2021-05-17 09:05:56
 * @LastEditTime: 2021-05-28 09:43:56
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \exam-serve\app.js
 */
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');

var indexRouter = require('./routes/index');
var userRouter = require('./routes/user');
var paperRouter = require('./routes/paper');
var classRouter = require('./routes/class');
var examRouter = require('./routes/exam')

var app = express();

app.use(logger('dev'));

app.use(express.json({ limit: '50mb' }));
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

app.use('/', indexRouter);
app.use('/user', userRouter);
app.use('/paper', paperRouter);
app.use('/class', classRouter);
app.use('/exam', examRouter);

module.exports = app;
